{layout name="./base/base_back"}

		<link rel="stylesheet" type="text/css" href="/front/css/realnameApprove.css"/>
		<script src="/front/js/index.js"></script>
		<!--实名认证开始-->
		<div id="real-name-box">
			<div id="real-name">
				{include file="./navleft"}
				<div class="real-name-right">
					<div class="real-name-tit">
						<span class="real-name-tit-left">实名认证</span>
					</div>
					<form action="/userinfo/identityinfoform" method="post" enctype="multipart/form-data">
						<div class="real-name-form">
							<div class="form-group-input">
								<label for="" class="form-label">姓 名：</label>
								<input type="text" name="name"  placeholder="请输入您的姓名"/>
								<span id="nameerror" style="color: red;"></span>
							</div>
							<div class="form-group-input">
								<label for="" class="form-label">身份证号码：</label>
								<input type="text" name="card_id"  placeholder="请输入您的身份证号"/>
								<span id="carderror" style="color: red;"></span>
							</div>
							<div class="form-group-input form-file">
								<label for="" class="form-label">上传身份证照片正面：</label>
								<input type="file" name="card_pic_z" />
							</div>
							<div class="form-group-input form-file">
								<label for="" class="form-label">上传身份证照片反面：</label>
								<input type="file" name="card_pic_f"/>
							</div>
							<div class="form-group-input form-button">
								<button type="submit">提交</button>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
		<!--实名认证结束-->
	</body>
</html>
<script type="text/javascript" src="/jquery.js"></script>
<script type="text/javascript">
    	$(function(){
    		//姓名验证
    		$("input[name='name']").blur(function(){
    			var name = $('input[name="name"]').val();
    			//不能为空
    			if(!$.trim(name)) {
					$("input[name='name']").css({border: "1px solid red"});
					$("#nameerror").html("请输入");
					return false;
    			}else{
    				$("input[name='name']").css({border: "1px solid green"});
    				$("#nameerror").html("");
    			}
    		})
    		//身份证验证
    		$("input[name='card_id']").blur(function(){
    			var idcard = $('input[name="card_id"]').val();
    			//不能为空
    			if(!$.trim(idcard)) {
					$("input[name='card_id']").css({border: "1px solid red"});
					$("#carderror").html("请输入");
					return false;
    			}else{
    				$.get('/userinfo/checkidentity?card_id='+$("input[name='card_id']").val(),function(data) {
						$("input[name='card_id']").css({border: "1px solid green"});
						$("#carderror").html("");
						if (data===0) {
							$("input[name='card_id']").css({border: "1px solid red"});
							$("#carderror").html("格式有误");
						}
					});
    			}
    		})
    	})
    </script>